﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenGL;

namespace Galaxy
{
	public class Spaceship : RigidBody
	{
		public List<Engine> Engines = new List<Engine>();
		public Spaceship(double mass)
			: base(mass)
		{

		}
		public void ConfigureEngine(V3D P, V3D D, double N)
		{
		}

		public void ThurstEngine(int Engine, double percent)
		{
		}
	}
	public class Engine:EnergyConsumer
	{
		V3D Position;
		V3D Direction;
		double MaxForce;
		PT1 Thurst;
		
		public double EnergyAtMax;
		public double ConsumedEnergy
		{
			get
			{
				return EnergyAtMax * Thurst.Value;
			}
		}
		public Engine(V3D p, V3D d, double f, double t)
		{
			Position = p;
			Direction = d;
			MaxForce = f;
			Thurst = new PT1(t, 1, 0);
		}
		public void SetThurst(double n)
		{
			Thurst.Set(MaxForce * n);
		}
		public void Process(double dt)
		{
			Thurst.Process(dt);
		}
	}
}